import {BasicColumn} from '/@/components/Table';
import {FormSchema} from '/@/components/Table';
import { rules} from '/@/utils/helper/validator';
import { render } from '/@/utils/common/renderUtils';
//列表数据
export const columns: BasicColumn[] = [
   {
    title: '机构分类',
    align:"center",
    dataIndex: 'medicalclass_dictText'
   },
   {
    title: '机构名称',
    align:"center",
    dataIndex: 'medicalName'
   },
   {
    title: '负责人',
    align:"center",
    dataIndex: 'medicalDirector'
   },
   {
    title: '联系方式',
    align:"center",
    dataIndex: 'medicalPhone'
   },
   {
    title: '机构地址',
    align:"center",
    dataIndex: 'medicalAddress'
   },
   {
    title: '机构首图',
    align:"center",
    dataIndex: 'medicalImgs',
    customRender:render.renderImage,
   },
   {
    title: '机构荣誉',
    align:"center",
    dataIndex: 'medicalHonor',
    customRender:render.renderImage,
   },
   {
    title: '机构详情',
    align:"center",
    dataIndex: 'medicalDetail',
    slots: { customRender: 'htmlSlot' },
   },
];
//查询数据
export const searchFormSchema: FormSchema[] = [
	{
      label: "机构分类",
      field: 'medicalclass',
      component: 'JDictSelectTag',
      componentProps:{
          dictCode:"mechanism"
      },
      colProps: {span: 6},
 	},
	{
      label: "机构名称",
      field: 'medicalName',
      component: 'Input',
      colProps: {span: 6},
 	},
	{
      label: "负责人",
      field: 'medicalDirector',
      component: 'Input',
      colProps: {span: 6},
 	},
];
//表单数据
export const formSchema: FormSchema[] = [
  {
    label: '机构分类',
    field: 'medicalclass',
    component: 'JDictSelectTag',
    componentProps:{
        dictCode:"mechanism"
     },
  },
  {
    label: '机构名称',
    field: 'medicalName',
    component: 'Input',
  },
  {
    label: '负责人',
    field: 'medicalDirector',
    component: 'Input',
  },
  {
    label: '联系方式',
    field: 'medicalPhone',
    component: 'Input',
  },
  {
    label: '机构地址',
    field: 'medicalAddress',
    component: 'Input',
  },
  {
    label: '机构首图',
    field: 'medicalImgs',
     component: 'JImageUpload',
     componentProps:{
        fileMax:1
      },
  },
  {
    label: '机构荣誉',
    field: 'medicalHonor',
     component: 'JImageUpload',
     componentProps:{
      },
  },
  {
    label: '机构详情',
    field: 'medicalDetail',
    component: 'JEditor',
  },
	// TODO 主键隐藏字段，目前写死为ID
	{
	  label: '',
	  field: 'id',
	  component: 'Input',
	  show: false
	},
];



/**
* 流程表单调用这个方法获取formSchema
* @param param
*/
export function getBpmFormSchema(_formData): FormSchema[]{
  // 默认和原始表单保持一致 如果流程中配置了权限数据，这里需要单独处理formSchema
  return formSchema;
}